#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int N = 110;
int n, m;
int a[N];
int mp[N], cnt[N];
struct node
{
	int p;
	vector<int>c;
}S[N];
int cmp(node a, node b)
{
	return a.p < b.p;
}
int main()
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		cin >> S[i].p;
		int z;
		cin >> z;
		while (z--) {
			int x;
			cin >> x;
			S[i].c.push_back(x);
		}
	}
	sort(S + 1, S + n + 1, cmp);
	//bool flag = 0;
	for (int i = 1; i <= n - 1; i++) {
		for (int j = i + 1; j <= n; j++) {
			memset(mp, 0, sizeof(mp));
			memset(cnt, 0, sizeof(cnt));
			if (S[i].c.size() < S[j].c.size())continue;
			for (int x : S[i].c) {
				mp[x] = 1;
				cnt[x]++;
			}
			bool flag1 = 0;
			bool flag2 = 0;
			for (int x : S[j].c) {
				cnt[x]--;
				mp[x] = 0;
			}
			for (int i = 1; i <= 100; i++) {
				if (cnt[i] < 0) {
					flag1 = 1;
				}
				if (mp[i])flag2 = 1;
			}
			bool flag3 = S[i].p < S[j].p;
			if (!flag1 && (flag3 || flag2)) {
				//cout << "i==" << i << endl;
				//cout << "j==" << j << endl;
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}